package mysqloperate;

import people.Student;
import people.User;

import java.sql.Connection;
import java.sql.Statement;

public class addstudentmysql {
    public addstudentmysql(){

    }
    public void addstudent(Student student)throws Exception{

        String sql="insert into student values('"+student.getStudentid()+"','"+student.getName()+"','"+student.getSEX()+"','"+student.getBirth()+"','"+student.getMath()+"','"+student.getJava()+"','"+student.getPe()+"')";
        connection con=new connection();
        Connection connection=con.getconnection();
        Statement statement=connection.createStatement();
        int num=statement.executeUpdate(sql);
        statement.close();
        connection.close();
    }
}
